package com.lej.app_main

import com.google.gson.JsonObject
import com.lej.dataservice.club.bean.main.my.MyUserInfoAll
import com.lej.dataservice.club.bean.main.unity.U3dWxPayInfo
import com.lej.dataservice.club.http.BaseResponse
import com.lej.dataservice.club.http.RetrofitClient
import com.lej.wx.data.WXShareInfo
import okhttp3.RequestBody
import org.json.JSONObject
import retrofit2.http.*

val mainService: MainService = RetrofitClient.getInstance().create(MainService::class.java)

interface MainService {
    @Headers("Content-Type: application/json")
    @POST("/test/umeng")
    suspend fun umeng(@Body body: RequestBody): BaseResponse<JSONObject>

    @Headers("Content-Type: application/json")
    @POST("/trove/config/shareInfo")
    suspend fun shareInfo(@Body body: RequestBody): BaseResponse<WXShareInfo>

    /**用户进入房间前检测*/
    @Headers("Content-Type: application/json")
    @GET("/trove/usersHouse/tcpAttr")
    suspend fun tcpAttr(@Query("house_id") houseId: Int): BaseResponse<JsonObject>

    /**获取用户信息*/
    @Headers("Content-Type: application/json")
    @GET("/trove/nfthouse/userinfo")
    suspend fun getUserInfo(): BaseResponse<MyUserInfoAll>

    /**
     * 求购订单支付
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/game/pay")
    suspend fun gameOrderPay(
        @Query("order_id") order_id: Int,
        @Query("pay_platform") pay_platform: Int,
        @Query("pay_type") pay_type: String = "app"
    ): BaseResponse<U3dWxPayInfo>

}